from php4dvd.pages.internal_page import InternalPage


class HomePage(InternalPage):

    @property
    def add_film_button(self):
        return self.driver.find_element_by_css_selector("img[alt=\"Add movie\"]")

    @property
    def search_field(self):
        return self.driver.find_element_by_id("q")

    @property
    def movie_list(self):
        return self.driver.find_elements_by_xpath("//div[starts-with(@id, 'movie_')]")

    @property
    def film(self, film):
        return self.driver.find_elements_by_xpath("//div[@class='title' and text()='" + film.name + "']")

